<template>
  <div>child子组件 - {{ count }} - {{ name }}</div>
</template>

<script lang="ts">
import { defineComponent, inject } from "vue";

export default defineComponent({
  props: {
    // count: Number,
    count: {
      type: Number,
    },
  },
  setup() {
    // inject的做法也是添加泛型
    const name = inject<string>("name");

    return { name };
  },
});
</script>
